﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Manage/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<QianBuo.Lottery.Web.Models.Surrogate.AccountReportModel>" %>
<%@ Import Namespace="Code.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    账户统计
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <% Html.DisableClientValidation(); %>
        <% Html.BeginForm(new { id = "accountreportform" }, new { ReturnUrl = Request["ReturnUrl"], act = Request["act"], cont = Request["cont"], arst = Request["arst"] }); %>
        <table class="table" width="100%">
            <tr class="th">
                <th colspan="5" align="left">
                    搜索条件(只能查询有账变用户)
                </th>
            </tr>
            <tr>
                <td>
                    <label for="Serch.UserType" id="Serch_UserType">
                        用户:</label>
                    <%=Html.TextBoxFor(p=>p.Serch.LoginName,new{@class="text80"}) %>
                </td>
                <td align="center">
                    <label for="Serch.UserType" id="Serch_UserType">
                        用户组:</label>
                    <%=Html.DropDownListFor(p =>Model.Serch.UserType, Model.UserTypes.Each(p => p.Selected = p.Text.Equals(Model.Serch.UserType)))%>
                </td>
                <td>
                    <label for="Serch_StartTime">
                        时间:</label>
                    <%=Html.TextBoxFor(p => p.Serch.StartTime, new { @class = "text80", onclick = "WdatePicker()" })%>
                </td>
                <td>
                    <label for="Serch_StartTime">
                        至:</label>
                    <%=Html.TextBoxFor(p => p.Serch.EndTime, new { @class = "text80", onclick = "WdatePicker()" })%>
                </td>
                <td>
                    <input type="submit" value="查找" />
                </td>
            </tr>
        </table>
        <%=Html.HiddenFor(p=>p.PageSize) %>
        <% Html.EndForm(); %>
        <p />
        <table class="table" width="100%" id="accountreport">
            <tr class="th">
                <th>
                    用户
                </th>
                <th>类型</th>
                <th>
                    充值
                </th>
                <th>
                    提款
                </th>
                <th>
                    购彩
                </th>
                <th>
                    返点
                </th>
                <th>
                    下级返点
                </th>
                <th>
                    中奖
                </th>
                <th>
                    下级返奖
                </th>
                <th>
                    盈利
                </th>
                <th>操作</th>
            </tr>
            <% if(Model.SumCount>0){
            var menu = new { act = Request["act"]??"AccountReport", cont = Request["cont"]??"User" , arst = Request["arst"] };
            var ReturnUrl = Url.Action("AccountReport", "User", Url.Route(new { Model.Serch, Model.PageSize, ReturnUrl = Request["ReturnUrl"] }, menu));
          foreach (var item in Model.Reports)
          {%>
            <tr>
                <td>
                    <%=item.LoginName %>
                </td>
                <td><%=((UserType)item.UserType).GetName() %></td>
                <td align="right">
                    <%=item.AddMoney.Value.ToString("F")%>
                </td>
                <td align="right">
                    <%=item.TackMoney.Value.ToString("F")%>
                </td>
                <td align="right">
                    <%=item.PlayMoney.Value.ToString("F")%>
                </td>
                <td align="right">
                    <%=item.BackMoney.Value.ToString("F")%>
                </td>
                <td align="right">
                    <%=item.BackMoney_Child.Value.ToString("F")%>
                </td>
                <td align="right">
                    <%=item.WinMoney.Value.ToString("F")%>
                </td>
                <td align="right">
                    <%=item.WinMoney_Child.Value.ToString("F")%>
                </td>
                <td align="right">
                    <%=(item.BackMoney + item.BackMoney_Child + item.WinMoney + item.WinMoney_Child - item.PlayMoney).Value.ToString("F") %>
                </td>
                <td>
                    <%=Html.ActionLink("详情", "AccountReportDetail", "User", Url.Route(new { Serch = new { LoginName = item.LoginName }, ReturnUrl, }, menu), Url.Route(new { @class = "a_blue" }))%>
                </td>
            </tr>
            <% } %>
            <tr>
                <td>
                    <font color="red">合计</font>
                </td>
                <td>&nbsp;</td>
                <td align="right">
                    <%=Model.SumReport.AddMoney.Value.ToString("F") %>
                </td>
                <td align="right">
                    <%=Model.SumReport.TackMoney.Value.ToString("F")%>
                </td>
                <td align="right">
                    <%=Model.SumReport.PlayMoney.Value.ToString("F")%>
                </td>
                <td align="right">
                    <%=Model.SumReport.BackMoney.Value.ToString("F")%>
                </td>
                <td align="right">
                    <%=Model.SumReport.BackMoney_Child.Value.ToString("F")%>
                </td>
                <td align="right">
                    <%=Model.SumReport.WinMoney.Value.ToString("F")%>
                </td>
                <td align="right">
                    <%=Model.SumReport.WinMoney_Child.Value.ToString("F")%>
                </td>
                <td align="right">
                    <%= (Model.SumReport.BackMoney + Model.SumReport.BackMoney_Child + Model.SumReport.WinMoney + Model.SumReport.WinMoney_Child - Model.SumReport.PlayMoney).Value.ToString("F")%>
                </td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td colspan="11">
                    <%=Html.Pager(Model.Page, Model.PageSize, Model.SumCount, "Page", Url.Route(new { Model.Serch, Model.PageSize, returnUrl = Request["ReturnUrl"], act = Request["act"], cont = Request["cont"], arst = Request["arst"] }), "PageSize")%>
                </td>
            </tr>
            <%}else{ %>
            <tr>
                <td colspan="11">
                    无记录！
                </td>
            </tr>
            <%} %>
        </table>
        <%if (Request["ReturnUrl"] != null)
      {%>
        <a class="a_blue" href='<%=Request["ReturnUrl"] %>'>&gt;&gt;返回</a>
        <%} %>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="StyleAndScript" runat="server">
    <script src='<%=Url.Content("~/Scripts/jquery.metadata.js") %>' type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#accountreportform").validate();
            $("#accountreportform #accountreport rd:odd").addClass("supersede");
        });
    </script>
</asp:Content>
